]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Use ::paint handler to set up spring animation
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 2 Jun 2017 02:22:36 +0000 (04:22 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 19 Jul 2017 08:49:54 +0000 (10:49 +0200)
The animation needs the icons' final positions, so we currently defer
it to a ::notify::allocation handler; however as starting the animation
during an allocation cycle would trigger a Clutter warning, it is
further deferred to a MetaLater. While this usually works, it is possible
that the allocation is already valid when we connect the signal, in which
case the animation is triggered at a later unexpected time. Switch to
a more robust ::paint handler instead, which also allows us to get rid
of the double-delay.

https://bugzilla.gnome.org/show_bug.cgi?id=736148

js/ui/appDisplay.js

index fe36deded8d0d021be598ecce08a6d1c997586c3..1cb8303724ac4ca44b9db1b9cf9de1deb0c0b3fb 100644 (file)
@@ -219,17 +219,10 @@ var BaseAppView = new Lang.Class({
         }
 
         if (animationDirection == IconGrid.AnimationDirection.IN) {
-            let toAnimate = this._grid.actor.connect('notify::allocation', Lang.bind(this,
-                function() {
-                    this._grid.actor.disconnect(toAnimate);
-                    // We need to hide the grid temporary to not flash it
-                    // for a frame
-                    this._grid.actor.opacity = 0;
-                    Meta.later_add(Meta.LaterType.BEFORE_REDRAW,
-                                   Lang.bind(this, function() {
-                                       this._doSpringAnimation(animationDirection)
-                                  }));
-                }));
+            let id = this._grid.actor.connect('paint', () => {
+                this._grid.actor.disconnect(id);
+                this._doSpringAnimation(animationDirection);
+            });
         } else {
             this._doSpringAnimation(animationDirection);
         }